<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>window</title>
    <script type="text/javascript">
        window.onload=function () {
            document.getElementById("open").onclick=function () {
                window.open("http://www.baidu.com/","_blank","toolbar=yes,location=yes,resizeable=no,directories=no,status=no,menubar=yes,scrollbars=yes,width=400,height=400");
            }
            document.getElementById("currlocation").onclick=function () {
                alert(decodeURI(window.location));
            }
            document.getElementById("newlocation").onclick=function () {
                window.location="http://www.baidu.com/";
            }
            document.getElementById("resizewindow").onclick=function () {
                window.resizeBy(-100,-100);
            }
            document.getElementById("timecount").onclick=function () {
                timeid=window.setInterval("timecount()",1000);
            }
            document.getElementById("stopcount").onclick=function () {
              window.clearInterval(timeid);
              count=1;
            }
        }
        var count=1;
        var timeid;
        function timecount() {
            document.getElementById("txt").value=count;
            count=count+1;
        }
    </script>
</head>
<body>
<input type="button" id="open" value="打开新窗口定制外观"><br>
<input type="button" id="currlocation" value="当前URL"><br>
<input type="button" id="newlocation" value="改变URL"><br>
<input type="button" id="resizewindow" value="调整窗口大小"><br>
<input type="button" id="timecount" value="开始计时">
<input type="text" id="txt" size="3">
<input type="button" id="stopcount" value="停止计时"><br>
<input type="button" id="scrollwindow" value="滚动"><br>
</body>
</html>